package com.atguigu.javase;

/**
 * @Author: shenhao
 * @CreatTime: 2024/10/4 11:26
 * @Version: 1.0
 * i++ ++i的区别 赋值和加一的先后
 */
public class IPlusPlus {
    public static void main(String[] args) {
        int i = 1;
        System.out.println("i = " + i); // 1
        System.out.println("++i = " + ++i);// 2
        System.out.println("i++ = " + i++);//2
        System.out.println("i = " + i);//3
        System.out.println("--i = " + --i);//2
        System.out.println("i-- = " + i--);//2
        System.out.println("i = " + i);//1
    }
}
